﻿using System.Web.Http.ExceptionHandling;
using Common.Logging;
using Newtonsoft.Json;

namespace Qy.Yzrb.Pipeline.ExceptionHandlers
{
    public class CommonLogExceptionLogger: ExceptionLogger
    {
        private static readonly ILog Logger = LogManager.GetLogger(typeof (CommonLogExceptionLogger));

        public override void Log(ExceptionLoggerContext context)
        {
            Logger.Error(JsonConvert.SerializeObject(context.ExceptionContext.Exception));
        }
    }
}